package xm.erzhan.conf.ResourcesConf;


public class ResourceMainConf {

    public static int costFood;
    public static int costSteel;
    public static int costOil;
    public static int costSlime;
    public static int product;
    public static int costSec;

    public static ResourceMainConf getResourceByType(String type, int lv) {
        ResourceMainConf resourceMainConf = null;

        if (lv < 0) lv = 0;
        if (lv > 9) lv = 9;

        if (type.equals("farmland")) {

            Farmland farmland = Farmland.shared();
            resourceMainConf.costFood = farmland.getConfByLv(lv).costFood;
            resourceMainConf.costSteel = farmland.getConfByLv(lv).costSteel;
            resourceMainConf.costOil = farmland.getConfByLv(lv).costOil;
            resourceMainConf.costSlime = farmland.getConfByLv(lv).costSlime;
            resourceMainConf.product = farmland.getConfByLv(lv).product;
            resourceMainConf.costSec = farmland.getConfByLv(lv).costSec;

        } else if (type.equals("steelmill")) {

            Steelmill steelmill = Steelmill.shared();
            resourceMainConf.costFood = steelmill.getConfByLv(lv).costFood;
            resourceMainConf.costSteel = steelmill.getConfByLv(lv).costSteel;
            resourceMainConf.costOil = steelmill.getConfByLv(lv).costOil;
            resourceMainConf.costSlime = steelmill.getConfByLv(lv).costSlime;
            resourceMainConf.product = steelmill.getConfByLv(lv).product;
            resourceMainConf.costSec = steelmill.getConfByLv(lv).costSec;

        } else if (type.equals("oilfield")) {

            Oilfield oilfield = Oilfield.shared();
            resourceMainConf.costFood = oilfield.getConfByLv(lv).costFood;
            resourceMainConf.costSteel = oilfield.getConfByLv(lv).costSteel;
            resourceMainConf.costOil = oilfield.getConfByLv(lv).costOil;
            resourceMainConf.costSlime = oilfield.getConfByLv(lv).costSlime;
            resourceMainConf.product = oilfield.getConfByLv(lv).product;
            resourceMainConf.costSec = oilfield.getConfByLv(lv).costSec;

        } else if (type.equals("mine")) {

            Mine mine = Mine.shared();
            resourceMainConf.costFood = mine.getConfByLv(lv).costFood;
            resourceMainConf.costSteel = mine.getConfByLv(lv).costSteel;
            resourceMainConf.costOil = mine.getConfByLv(lv).costOil;
            resourceMainConf.costSlime = mine.getConfByLv(lv).costSlime;
            resourceMainConf.product = mine.getConfByLv(lv).product;
            resourceMainConf.costSec = mine.getConfByLv(lv).costSec;

        } else if (type.equals("houses")) {

            Houses houses = Houses.shared();
            resourceMainConf.costFood = houses.getConfByLv(lv).costFood;
            resourceMainConf.costSteel = houses.getConfByLv(lv).costSteel;
            resourceMainConf.costOil = houses.getConfByLv(lv).costOil;
            resourceMainConf.costSlime = houses.getConfByLv(lv).costSlime;
            resourceMainConf.product = houses.getConfByLv(lv).product;
            resourceMainConf.costSec = houses.getConfByLv(lv).costSec;
        }

        return resourceMainConf;
    }
}
